]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st: Adapt to CoglObject removal
authorBilal Elmoussaoui <belmouss@redhat.com>
Tue, 19 Sep 2023 18:31:56 +0000 (20:31 +0200)
committerMarge Bot <marge-bot@gnome.org>
Sun, 29 Oct 2023 21:28:31 +0000 (21:28 +0000)
Also use more memory management macro helpers

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2964>

14 files changed:
src/shell-blur-effect.c
src/shell-glsl-effect.c
src/shell-invert-lightness-effect.c
src/shell-screenshot.c
src/st/st-entry.c
src/st/st-icon.c
src/st/st-label.c
src/st/st-private.c
src/st/st-scroll-view-fade.c
src/st/st-shadow.c
src/st/st-texture-cache.c
src/st/st-theme-node-drawing.c
src/st/st-theme-node-transition.c
src/st/st-theme-node.c

index a9ac9d37f458a91e01085d029ae4b5c2b6301ef2..4f2acc4b9d9f59125abc0adb25b7dc412a6474f2 100644 (file)
@@ -138,7 +138,7 @@ create_brightness_pipeline (void)
                                   brightness_glsl_declarations,
                                   brightness_glsl);
       cogl_pipeline_add_snippet (brightness_pipeline, snippet);
-      cogl_object_unref (snippet);
+      g_object_unref (snippet);
     }
 
   return cogl_pipeline_copy (brightness_pipeline);
@@ -188,7 +188,7 @@ update_fbo (FramebufferData *data,
   CoglContext *ctx =
     clutter_backend_get_cogl_context (clutter_get_default_backend ());
 
-  g_clear_pointer (&data->texture, cogl_object_unref);
+  g_clear_object (&data->texture);
   g_clear_object (&data->framebuffer);
 
   float new_width = floorf (width / downscale_factor);
@@ -269,7 +269,7 @@ update_background_fbo (ShellBlurEffect *self,
 static void
 clear_framebuffer_data (FramebufferData *fb_data)
 {
-  g_clear_pointer (&fb_data->texture, cogl_object_unref);
+  g_clear_object (&fb_data->texture);
   g_clear_object (&fb_data->framebuffer);
 }
 
@@ -697,9 +697,9 @@ shell_blur_effect_finalize (GObject *object)
   clear_framebuffer_data (&self->background_fb);
   clear_framebuffer_data (&self->brightness_fb);
 
-  g_clear_pointer (&self->actor_fb.pipeline, cogl_object_unref);
-  g_clear_pointer (&self->background_fb.pipeline, cogl_object_unref);
-  g_clear_pointer (&self->brightness_fb.pipeline, cogl_object_unref);
+  g_clear_object (&self->actor_fb.pipeline);
+  g_clear_object (&self->background_fb.pipeline);
+  g_clear_object (&self->brightness_fb.pipeline);
 
   G_OBJECT_CLASS (shell_blur_effect_parent_class)->finalize (object);
 }
index 6eb6e4278532b63335ffa4fd32fbe77a386dce1c..7c0bcfa22a06e52d58b50606c0c10af51fdac5fa 100644 (file)
@@ -31,7 +31,7 @@ shell_glsl_effect_create_pipeline (ClutterOffscreenEffect *effect,
 
   cogl_pipeline_set_layer_texture (priv->pipeline, 0, texture);
 
-  return cogl_object_ref (priv->pipeline);
+  return g_object_ref (priv->pipeline);
 }
 
 /**
@@ -76,7 +76,7 @@ shell_glsl_effect_add_glsl_snippet (ShellGLSLEffect  *effect,
   else
     cogl_pipeline_add_layer_snippet (klass->base_pipeline, 0, snippet);
 
-  cogl_object_unref (snippet);
+  g_object_unref (snippet);
 }
 
 static void
@@ -87,7 +87,7 @@ shell_glsl_effect_dispose (GObject *gobject)
 
   priv = shell_glsl_effect_get_instance_private (self);
 
-  g_clear_pointer (&priv->pipeline, cogl_object_unref);
+  g_clear_object (&priv->pipeline);
 
   G_OBJECT_CLASS (shell_glsl_effect_parent_class)->dispose (gobject);
 }
index f856ede6121015a903dbf062bcc500de435a470d..8979732932cb921305e60476870c48570ddde288 100644 (file)
@@ -80,7 +80,7 @@ shell_glsl_effect_create_pipeline (ClutterOffscreenEffect *effect,
 
   cogl_pipeline_set_layer_texture (self->pipeline, 0, texture);
 
-  return cogl_object_ref (self->pipeline);
+  return g_object_ref (self->pipeline);
 }
 
 static void
@@ -88,11 +88,7 @@ shell_invert_lightness_effect_dispose (GObject *gobject)
 {
   ShellInvertLightnessEffect *self = SHELL_INVERT_LIGHTNESS_EFFECT (gobject);
 
-  if (self->pipeline != NULL)
-    {
-      cogl_object_unref (self->pipeline);
-      self->pipeline = NULL;
-    }
+  g_clear_object (&self->pipeline);
 
   G_OBJECT_CLASS (shell_invert_lightness_effect_parent_class)->dispose (gobject);
 }
@@ -128,7 +124,7 @@ shell_invert_lightness_effect_init (ShellInvertLightnessEffect *self)
                                   NULL);
       cogl_snippet_set_replace (snippet, invert_lightness_source);
       cogl_pipeline_add_layer_snippet (klass->base_pipeline, 0, snippet);
-      cogl_object_unref (snippet);
+      g_object_unref (snippet);
 
       cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
     }
index 4c47eb0765b3ee23ad51f49113139b1f3f009ab1..2c384fcf665c62368d5b23774fec59cd81574eed 100644 (file)
@@ -525,7 +525,7 @@ grab_screenshot_content (ShellScreenshot *screenshot,
       unsigned int width, height;
       CoglContext *ctx;
       CoglPipeline *pipeline;
-      CoglTexture2D *texture;
+      CoglTexture *texture;
       CoglOffscreen *offscreen;
       ClutterStageView *view;
 
@@ -548,12 +548,12 @@ grab_screenshot_content (ShellScreenshot *screenshot,
                                                 pipeline,
                                                 -1, 1, 1, -1,
                                                 0, 0, 1, 1);
-      cogl_object_unref (pipeline);
+      g_object_unref (pipeline);
       g_object_unref (offscreen);
 
       priv->cursor_content =
         clutter_texture_content_new_from_texture (texture, NULL);
-      cogl_object_unref (texture);
+      g_object_unref (texture);
 
       priv->cursor_scale = meta_cursor_tracker_get_scale (tracker);
 
@@ -1313,7 +1313,7 @@ shell_screenshot_composite_to_stream (CoglTexture         *texture,
                          cairo_image_surface_get_data (surface));
   cairo_surface_mark_dirty (surface);
 
-  cogl_object_unref (sub_texture);
+  g_object_unref (sub_texture);
 
   cairo_surface_set_device_scale (surface, scale, scale);
 
index 0de195ebcf778b287edf2e7603d03835555fda81..52fbdb7e2b638f4e9f4892a17bec4ac9085356fe 100644 (file)
@@ -216,7 +216,7 @@ st_entry_dispose (GObject *object)
   StEntry *entry = ST_ENTRY (object);
   StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
 
-  cogl_clear_object (&priv->text_shadow_material);
+  g_clear_object (&priv->text_shadow_material);
 
   G_OBJECT_CLASS (st_entry_parent_class)->dispose (object);
 }
@@ -254,7 +254,7 @@ st_entry_style_changed (StWidget *self)
   if (!priv->shadow_spec || !shadow_spec ||
       !st_shadow_equal (shadow_spec, priv->shadow_spec))
     {
-      g_clear_pointer (&priv->text_shadow_material, cogl_object_unref);
+      g_clear_object (&priv->text_shadow_material);
 
       g_clear_pointer (&priv->shadow_spec, st_shadow_unref);
       if (shadow_spec)
@@ -555,7 +555,7 @@ clutter_text_cursor_changed (ClutterText *text,
 
   st_entry_update_hint_visibility (entry);
 
-  g_clear_pointer (&priv->text_shadow_material, cogl_object_unref);
+  g_clear_object (&priv->text_shadow_material);
 }
 
 static void
@@ -569,7 +569,7 @@ clutter_text_changed_cb (GObject    *object,
   st_entry_update_hint_visibility (entry);
 
   /* Since the text changed, force a regen of the shadow texture */
-  cogl_clear_object (&priv->text_shadow_material);
+  g_clear_object (&priv->text_shadow_material);
 
   g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_TEXT]);
 }
@@ -581,7 +581,7 @@ invalidate_shadow_pipeline (GObject    *object,
 {
   StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
 
-  g_clear_pointer (&priv->text_shadow_material, cogl_object_unref);
+  g_clear_object (&priv->text_shadow_material);
 }
 
 static void
@@ -839,7 +839,7 @@ st_entry_paint (ClutterActor        *actor,
         {
           CoglPipeline *material;
 
-          cogl_clear_object (&priv->text_shadow_material);
+          g_clear_object (&priv->text_shadow_material);
 
           material = _st_create_shadow_pipeline_from_actor (priv->shadow_spec,
                                                             priv->entry);
index 4f23090d0f25600fe07c168d817fd096b55017f2..aed688e07d8c64d4877c3f6a77d1ef301c60e53b 100644 (file)
@@ -173,7 +173,7 @@ st_icon_dispose (GObject *gobject)
   g_clear_object (&priv->gicon);
   g_clear_object (&priv->fallback_gicon);
   g_clear_pointer (&priv->colors, st_icon_colors_unref);
-  g_clear_pointer (&priv->shadow_pipeline, cogl_object_unref);
+  g_clear_object (&priv->shadow_pipeline);
   g_clear_pointer (&priv->shadow_spec, st_shadow_unref);
 
   G_OBJECT_CLASS (st_icon_parent_class)->dispose (gobject);
@@ -377,7 +377,7 @@ st_icon_clear_shadow_pipeline (StIcon *icon)
 {
   StIconPrivate *priv = icon->priv;
 
-  g_clear_pointer (&priv->shadow_pipeline, cogl_object_unref);
+  g_clear_object (&priv->shadow_pipeline);
   graphene_size_init (&priv->shadow_size, 0, 0);
 }
 
index fe77743c4438b804c0470b68020e10f2bc552075..71cadb58d0e199ceacd2db52810d9ee9b6d16853 100644 (file)
@@ -130,7 +130,7 @@ st_label_style_changed (StWidget *self)
   if (!priv->shadow_spec || !shadow_spec ||
       !st_shadow_equal (shadow_spec, priv->shadow_spec))
     {
-      g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+      g_clear_object (&priv->text_shadow_pipeline);
 
       g_clear_pointer (&priv->shadow_spec, st_shadow_unref);
       if (shadow_spec)
@@ -199,7 +199,7 @@ st_label_dispose (GObject   *object)
   StLabelPrivate *priv = ST_LABEL (object)->priv;
 
   priv->label = NULL;
-  g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+  g_clear_object (&priv->text_shadow_pipeline);
 
   G_OBJECT_CLASS (st_label_parent_class)->dispose (object);
 }
@@ -230,7 +230,7 @@ st_label_paint (ClutterActor        *actor,
           width != priv->shadow_width ||
           height != priv->shadow_height)
         {
-          g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+          g_clear_object (&priv->text_shadow_pipeline);
 
           priv->shadow_width = width;
           priv->shadow_height = height;
@@ -261,7 +261,7 @@ st_label_resource_scale_changed (ClutterActor *actor)
 {
   StLabelPrivate *priv = ST_LABEL (actor)->priv;
 
-  g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+  g_clear_object (&priv->text_shadow_pipeline);
 
   if (CLUTTER_ACTOR_CLASS (st_label_parent_class)->resource_scale_changed)
     CLUTTER_ACTOR_CLASS (st_label_parent_class)->resource_scale_changed (actor);
@@ -321,7 +321,7 @@ invalidate_shadow_pipeline (GObject    *object,
 {
   StLabelPrivate *priv = st_label_get_instance_private (label);
 
-  g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+  g_clear_object (&priv->text_shadow_pipeline);
 }
 
 static void
@@ -416,7 +416,7 @@ st_label_set_text (StLabel     *label,
   if (clutter_text_get_editable (ctext) ||
       g_strcmp0 (clutter_text_get_text (ctext), text) != 0)
     {
-      g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+      g_clear_object (&priv->text_shadow_pipeline);
 
       clutter_text_set_text (ctext, text);
 
index bb981516dc8ac8a2dfee156840cc47e28a46309b..50a22f28dbc43659719d28df1ca1a87ed8087825 100644 (file)
@@ -420,7 +420,7 @@ _st_create_shadow_pipeline (StShadow    *shadow_spec,
   fb = COGL_FRAMEBUFFER (offscreen);
   if (!cogl_framebuffer_allocate (fb, &error))
     {
-      cogl_clear_object (&texture);
+      g_clear_object (&texture);
       return NULL;
     }
 
@@ -450,7 +450,7 @@ _st_create_shadow_pipeline (StShadow    *shadow_spec,
 
       texture_pipeline = cogl_pipeline_new (ctx);
       cogl_pipeline_add_snippet (texture_pipeline, snippet);
-      cogl_object_unref (snippet);
+      g_object_unref (snippet);
 
       cogl_context_set_named_pipeline (ctx,
                                        &texture_pipeline_key,
@@ -493,7 +493,7 @@ _st_create_shadow_pipeline (StShadow    *shadow_spec,
   pipeline = cogl_pipeline_copy (shadow_pipeline_template);
   cogl_pipeline_set_layer_texture (pipeline, 0, texture);
 
-  cogl_clear_object (&texture);
+  g_clear_object (&texture);
 
   return pipeline;
 }
@@ -535,7 +535,7 @@ _st_create_shadow_pipeline_from_actor (StShadow     *shadow_spec,
 
   if (shadow_pipeline == NULL)
     {
-      CoglTexture *buffer;
+      g_autoptr(CoglTexture) buffer = NULL;
       CoglOffscreen *offscreen;
       CoglFramebuffer *fb;
       CoglContext *ctx;
@@ -556,7 +556,6 @@ _st_create_shadow_pipeline_from_actor (StShadow     *shadow_spec,
         {
           g_error_free (catch_error);
           g_object_unref (offscreen);
-          cogl_object_unref (buffer);
           return NULL;
         }
 
@@ -582,10 +581,9 @@ _st_create_shadow_pipeline_from_actor (StShadow     *shadow_spec,
 
       g_object_unref (fb);
 
-      shadow_pipeline = _st_create_shadow_pipeline (shadow_spec, buffer,
+      shadow_pipeline = _st_create_shadow_pipeline (shadow_spec,
+                                                    g_steal_pointer (&buffer),
                                                     resource_scale);
-
-      cogl_object_unref (buffer);
     }
 
   return shadow_pipeline;
index 77b1d0b12083038f7978120f94d164f4d58054d0..440b712e75ed52ccbc74efdc12f3560c4bfdcac8 100644 (file)
@@ -74,7 +74,7 @@ st_scroll_view_fade_create_texture (ClutterOffscreenEffect *effect,
   CoglContext *ctx =
     clutter_backend_get_cogl_context (clutter_get_default_backend ());
 
-  return COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, min_width, min_height));
+  return cogl_texture_2d_new_with_size (ctx, min_width, min_height);
 }
 
 static char *
index 97edbe90c3ba4627123f565315bcbef1c891a1cb..a5a0a85d094559253ad937be7740bc55f9ee5af0 100644 (file)
@@ -234,7 +234,7 @@ st_shadow_helper_update (StShadowHelper *helper,
       helper->height != height)
     {
       if (helper->pipeline)
-        cogl_object_unref (helper->pipeline);
+        g_object_unref (helper->pipeline);
 
       helper->pipeline = _st_create_shadow_pipeline_from_actor (helper->shadow, source);
       helper->width = width;
@@ -256,7 +256,7 @@ st_shadow_helper_copy (StShadowHelper *helper)
   copy = g_new (StShadowHelper, 1);
   *copy = *helper;
   if (copy->pipeline)
-    cogl_object_ref (copy->pipeline);
+    g_object_ref (copy->pipeline);
   st_shadow_ref (copy->shadow);
 
   return copy;
@@ -272,7 +272,7 @@ void
 st_shadow_helper_free (StShadowHelper *helper)
 {
   if (helper->pipeline)
-    cogl_object_unref (helper->pipeline);
+    g_object_unref (helper->pipeline);
   st_shadow_unref (helper->shadow);
 
   g_free (helper);
index 7037c07d1511b34880549cac837a7e5e99c980b0..2986f5bb3493703de44e5f412b2fa2e89e406bf8 100644 (file)
@@ -978,7 +978,7 @@ st_texture_cache_load (StTextureCache       *cache,
     }
 
   if (texture && policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
-    cogl_object_ref (texture);
+    g_object_ref (texture);
 
   return texture;
 }
@@ -1604,7 +1604,7 @@ st_texture_cache_load_file_sync_to_cogl_texture (StTextureCache *cache,
    * clutter_image_set_data(), so it's safe to use the texture
    * of ClutterImage here. */
   texdata = clutter_image_get_texture (CLUTTER_IMAGE (image));
-  cogl_object_ref (texdata);
+  g_object_ref (texdata);
 
   ensure_monitor_for_file (cache, file);
 
index 13a6d93c371198ce820af5c5f1dfdb02e67a6eba..ceb4c64fcb5d1cf2f3574d88f3296365cf6d4679 100644 (file)
@@ -180,11 +180,11 @@ create_corner_material (StCornerSpec *corner)
 
   cairo_surface_destroy (surface);
 
-  texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx, size, size,
-                                                         COGL_PIXEL_FORMAT_CAIRO_ARGB32_COMPAT,
-                                                         rowstride,
-                                                         data,
-                                                         &error));
+  texture = cogl_texture_2d_new_from_data (ctx, size, size,
+                                           COGL_PIXEL_FORMAT_CAIRO_ARGB32_COMPAT,
+                                           rowstride,
+                                           data,
+                                           &error);
 
   if (error)
     {
@@ -427,7 +427,7 @@ st_theme_node_lookup_corner (StThemeNode    *node,
   if (texture)
     {
       material = _st_create_texture_pipeline (texture);
-      cogl_object_unref (texture);
+      g_object_unref (texture);
     }
 
   g_free (key);
@@ -1341,13 +1341,13 @@ st_theme_node_prerender_background (StThemeNode *node,
   if (interior_path != NULL)
     cairo_path_destroy (interior_path);
 
-  texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx,
-                                                         texture_width,
-                                                         texture_height,
-                                                         COGL_PIXEL_FORMAT_CAIRO_ARGB32_COMPAT,
-                                                         rowstride,
-                                                         data,
-                                                         &error));
+  texture = cogl_texture_2d_new_from_data (ctx,
+                                           texture_width,
+                                           texture_height,
+                                           COGL_PIXEL_FORMAT_CAIRO_ARGB32_COMPAT,
+                                           rowstride,
+                                           data,
+                                           &error);
 
   if (error)
     {
@@ -1371,8 +1371,8 @@ static void st_theme_node_paint_borders (StThemeNodePaintState *state,
 void
 st_theme_node_invalidate_border_image (StThemeNode *node)
 {
-  cogl_clear_object (&node->border_slices_texture);
-  cogl_clear_object (&node->border_slices_pipeline);
+  g_clear_object (&node->border_slices_texture);
+  g_clear_object (&node->border_slices_pipeline);
 }
 
 static gboolean
@@ -1407,9 +1407,9 @@ st_theme_node_load_border_image (StThemeNode *node,
 void
 st_theme_node_invalidate_background_image (StThemeNode *node)
 {
-  cogl_clear_object (&node->background_texture);
-  cogl_clear_object (&node->background_pipeline);
-  cogl_clear_object (&node->background_shadow_pipeline);
+  g_clear_object (&node->background_texture);
+  g_clear_object (&node->background_pipeline);
+  g_clear_object (&node->background_shadow_pipeline);
 }
 
 static gboolean
@@ -1624,16 +1624,16 @@ st_theme_node_update_resources (StThemeNodePaintState *state,
 
   /* Free handles we can't reuse */
   had_prerendered_texture = (state->prerendered_texture != NULL);
-  cogl_clear_object (&state->prerendered_texture);
+  g_clear_object (&state->prerendered_texture);
 
   if (state->prerendered_pipeline != NULL)
     {
-      cogl_clear_object (&state->prerendered_pipeline);
+      g_clear_object (&state->prerendered_pipeline);
 
       if (node->border_slices_texture == NULL &&
           state->box_shadow_pipeline != NULL)
         {
-          cogl_clear_object (&state->box_shadow_pipeline);
+          g_clear_object (&state->box_shadow_pipeline);
           had_box_shadow = TRUE;
         }
     }
@@ -2317,7 +2317,7 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
   /* Render offscreen */
   fb_width = ceilf (state->box_shadow_width * state->resource_scale);
   fb_height = ceilf (state->box_shadow_height * state->resource_scale);
-  buffer = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, fb_width, fb_height));
+  buffer = cogl_texture_2d_new_with_size (ctx, fb_width, fb_height);
   if (buffer == NULL)
     return;
 
@@ -2343,7 +2343,7 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
 
   g_clear_error (&error);
   g_clear_object (&offscreen);
-  cogl_clear_object (&buffer);
+  g_clear_object (&buffer);
 }
 
 static void
@@ -2754,12 +2754,12 @@ st_theme_node_paint_state_node_free_internal (StThemeNodePaintState *state,
 {
   int corner_id;
 
-  cogl_clear_object (&state->prerendered_texture);
-  cogl_clear_object (&state->prerendered_pipeline);
-  cogl_clear_object (&state->box_shadow_pipeline);
+  g_clear_object (&state->prerendered_texture);
+  g_clear_object (&state->prerendered_pipeline);
+  g_clear_object (&state->box_shadow_pipeline);
 
   for (corner_id = 0; corner_id < 4; corner_id++)
-    cogl_clear_object (&state->corner_material[corner_id]);
+    g_clear_object (&state->corner_material[corner_id]);
 
   if (unref_node)
     st_theme_node_paint_state_set_node (state, NULL);
@@ -2831,14 +2831,14 @@ st_theme_node_paint_state_copy (StThemeNodePaintState *state,
   state->box_shadow_height = other->box_shadow_height;
 
   if (other->box_shadow_pipeline)
-    state->box_shadow_pipeline = cogl_object_ref (other->box_shadow_pipeline);
+    state->box_shadow_pipeline = g_object_ref (other->box_shadow_pipeline);
   if (other->prerendered_texture)
-    state->prerendered_texture = cogl_object_ref (other->prerendered_texture);
+    state->prerendered_texture = g_object_ref (other->prerendered_texture);
   if (other->prerendered_pipeline)
-    state->prerendered_pipeline = cogl_object_ref (other->prerendered_pipeline);
+    state->prerendered_pipeline = g_object_ref (other->prerendered_pipeline);
   for (corner_id = 0; corner_id < 4; corner_id++)
     if (other->corner_material[corner_id])
-      state->corner_material[corner_id] = cogl_object_ref (other->corner_material[corner_id]);
+      state->corner_material[corner_id] = g_object_ref (other->corner_material[corner_id]);
 }
 
 void
index 20b1476d2d43e046a75e99b751e323462af45747..0fab79617aa0351618467a783de3c0d75d68b964 100644 (file)
@@ -262,11 +262,11 @@ setup_framebuffers (StThemeNodeTransition *transition,
   g_return_val_if_fail (width  > 0, FALSE);
   g_return_val_if_fail (height > 0, FALSE);
 
-  cogl_clear_object (&priv->old_texture);
-  priv->old_texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));
+  g_clear_object (&priv->old_texture);
+  priv->old_texture = cogl_texture_2d_new_with_size (ctx, width, height);
 
-  cogl_clear_object (&priv->new_texture);
-  priv->new_texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));
+  g_clear_object (&priv->new_texture);
+  priv->new_texture = cogl_texture_2d_new_with_size (ctx, width, height);
 
   if (priv->old_texture == NULL)
     return FALSE;
@@ -402,13 +402,13 @@ st_theme_node_transition_dispose (GObject *object)
   g_clear_object (&priv->old_theme_node);
   g_clear_object (&priv->new_theme_node);
 
-  cogl_clear_object (&priv->old_texture);
-  cogl_clear_object (&priv->new_texture);
+  g_clear_object (&priv->old_texture);
+  g_clear_object (&priv->new_texture);
 
   g_clear_object (&priv->old_offscreen);
   g_clear_object (&priv->new_offscreen);
 
-  cogl_clear_object (&priv->material);
+  g_clear_object (&priv->material);
 
   if (priv->timeline)
     {
index 6e09c3939a33f0d7d8857290232dbebd7a88da00..51e6d21740657fa039151fffcda9f3147b067d4c 100644 (file)
@@ -127,12 +127,12 @@ st_theme_node_finalize (GObject *object)
 
   g_clear_object (&node->background_image);
 
-  cogl_clear_object (&node->background_texture);
-  cogl_clear_object (&node->background_pipeline);
-  cogl_clear_object (&node->background_shadow_pipeline);
-  cogl_clear_object (&node->border_slices_texture);
-  cogl_clear_object (&node->border_slices_pipeline);
-  cogl_clear_object (&node->color_pipeline);
+  g_clear_object (&node->background_texture);
+  g_clear_object (&node->background_pipeline);
+  g_clear_object (&node->background_shadow_pipeline);
+  g_clear_object (&node->border_slices_texture);
+  g_clear_object (&node->border_slices_pipeline);
+  g_clear_object (&node->color_pipeline);
 
   G_OBJECT_CLASS (st_theme_node_parent_class)->finalize (object);
 }